﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp.Study.Test
{
    public class 获取当前程序文件路径
    {
        public static void Go()
        {
            var path = "D:/package/package_1";
            //var file = new FileInfo(path);
            //var relativePath = Path.GetRelativePath("D:/package/", path);
            //var fileStream = File.OpenRead(path);


            var dir = new DirectoryInfo(path);
            var files = dir.GetFiles("", SearchOption.AllDirectories);
            var dic = files.ToDictionary(t => Path.GetRelativePath(path, t.FullName), t => (Stream)t.OpenRead());
            //string a = Environment.CurrentDirectory;//当前.exe文件的目录
            //string b = AppDomain.CurrentDomain.BaseDirectory;
            //string path = @"E:\OutSoftsAppPackage\2022-05-30_510aaa4e4bd34ad6b9a455adf05a352e\47d5a5334460daaa\2b9702b8f7f2e95e\SysTableData\tb___sys_tree.txt";
            //string root = Directory.GetDirectoryRoot(path);
        }
    }
}
